Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a pretty printer for &mut slices #34550

Merged
merged 1 commit into from
Jul 4, 2016
Merged

Conversation

nikhilshagri
Copy link
Contributor

Fixes #30232
I have added a test which checks for correctness in gdb, but I need some help to do the same for lldb.

r? @Manishearth

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Manishearth
Copy link
Member

@bors r+

Adding an lldb test can be an easy bug (or I might just fix it myself)

@bors
Copy link
Contributor

bors commented Jun 29, 2016

📌 Commit 688f8f8 has been approved by Manishearth

@Manishearth
Copy link
Member

Thanks!

@nikhilshagri
Copy link
Contributor Author

heh, I should be the one thanking you for patiently answering every question I had!

@bors
Copy link
Contributor

bors commented Jul 1, 2016

⌛ Testing commit 688f8f8 with merge be76d67...

@bors
Copy link
Contributor

bors commented Jul 1, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@Manishearth
Copy link
Member

@bors retry

  • llvm clone failed

@bors
Copy link
Contributor

bors commented Jul 1, 2016

⌛ Testing commit 688f8f8 with merge 23e5104...

@bors
Copy link
Contributor

bors commented Jul 1, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@Manishearth
Copy link
Member

Looks like the builder is broken. We'll retry this later.

@alexcrichton
Copy link
Member

@bors: retry

On Fri, Jul 1, 2016 at 6:19 AM, Manish Goregaokar [email protected]
wrote:

Looks like the builder is broken. We'll retry this later.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#34550 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAD95Golu_FRL3evhHA7UBGwczkGPPsUks5qRRPcgaJpZM4JBNPu
.

@bors
Copy link
Contributor

bors commented Jul 2, 2016

⌛ Testing commit 688f8f8 with merge bbd39ac...

@bors
Copy link
Contributor

bors commented Jul 3, 2016

💔 Test failed - auto-linux-64-x-android-t

@@ -53,6 +53,11 @@
// gdb-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
// gdb-check:$15 = {64, 65}

//gdb-command:print mut_slice.length
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, these tests are unnecessary, we just need a test that verifies that printing mut_slice gives properly formatted results.

Copy link
Contributor Author

@nikhilshagri nikhilshagri Jul 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that is done in the second test, right? I looked at the buildbot logs and noticed that's exactly where the build was failing:


---- [debuginfo-gdb] debuginfo-gdb/vec-slices.rs stdout ----

error: line not found in debugger output: $17 = {1, 2, 3, 4, 5}
status: exit code: 0
command: arm-linux-androideabi-gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debuginfo-gdb/vec-slices.debugger.script
stdout:
------------------------------------------

Edit:
Also, the output in stderr:

x86_64-unknown-linux-gnu/test/debuginfo-gdb/vec-slices.debugger.script:24: Error in sourced command file:
No symbol "int32_t" in current context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second one casts it to an array and tries to print it. That relies on the C pretty printer, not ten Rust one. print slice and print mut_slice should be what we are testing. I don't see the value in the array-cast test for mut slices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print mut_slice just shows the data pointer and the array's length. I looked at the pretty-printer's code as well, but I couldn't understand much :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's what we've been trying to fix here 😄 print mut_slice should show an array, just like print slice

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, these tests aren't run with rust-gdb, it would appear as if rust-gdb doesn't have tests. So remove the test changes and we can land this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the error is occurring due to absence of int32_t, maybe I could change the type to i64, since previous examples have used it, and obviously they have passed all the tests/builds. what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it.

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 3, 2016

📌 Commit 036b089 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Jul 4, 2016

⌛ Testing commit 036b089 with merge d98da85...

bors added a commit that referenced this pull request Jul 4, 2016
Added a pretty printer for &mut slices

Fixes #30232
I have added a test which checks for correctness in gdb, but I need some help to do the same for lldb.

r? @Manishearth
@bors bors merged commit 036b089 into rust-lang:master Jul 4, 2016
@nikhilshagri
Copy link
Contributor Author

It worked! 😎 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants